﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.IO;
namespace StreetSmartAdmin
{
    public partial class EmailTemplate : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //((Label)Header.FindControl("lblUser")).Text = ((Userinfo)Session["UserInfo"]).fullname; 
            //((Label)Header.FindControl("lblUser")).Text = ((String)Session["UserName"]);
            ((Label)Header.FindControl("lblUser")).Text = (User.Identity.Name);
            gvPerson.DataSourceID="SqlDataSource1";
        }

        protected void lbtnAdd_Click(object sender, EventArgs e)
        {
            string connectionString = null;
            System.Configuration.ConnectionStringSettings connString = System.Configuration.ConfigurationManager.ConnectionStrings["SQLServer2005DBConnectionString"];
            if (null != connString)
                connectionString = connString.ConnectionString;
            SqlConnection connection = null;
            connection = new SqlConnection(connectionString);
            connection.Open();
            SqlCommand command;
            command = connection.CreateCommand();
            command.CommandText = "INSERT INTO glob1001.[tblEmailTemplate] (EmailTemplateName,EmailTemplateSubject,EmailTemplateBody) Values('','','')";
            command.ExecuteNonQuery();
            connection.Close();
        }

    }
}